<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <script>
        let student = {
            name: 'zhangsan',
            age: 23
        }

        function Animal() {
            this.name = 'zhangsan';
            this.age = 23;
            this.run = function () {
                console.log('姓名：' + this.name + ',年龄：' + this.age);
            }
        }
        var cat = new Animal();
        cat.run();

        {
            let a = 1
            var b = 2
        }
        //console.log(a)
        console.log(b)

        //for循环的计数器，就很合适使用let命令。
        for (let i = 0; i < 10; i++) {
            // ...
        }
        //console.log(i);// ReferenceError: i is not defined

        const PI = 3.14
        //Attempt to assign to const or readonly variable
        //PI = 3.1415

        //'const' variable without initializer is not allowed
        //const foo;
    </script>
</body>
</html>